package com.study.iterator.general;

public class Test {
    public static void main(String[] args) {
        IAggregate<String> aggregate = new ConcreteAggregate<>();
        aggregate.add("one");
        aggregate.add("two");
        aggregate.add("three");

        Iterator<String> iterator = aggregate.iterator();
        while (iterator.hasNext()){
            String element = iterator.next();
            System.out.println(element);
        }
    }
}
